package com.szy.repo.impl;

import com.szy.entity.User;
import com.szy.repo.AbstractQueryDSLRepo;
import com.szy.repo.UserRepositoryCustom;

import static com.szy.entity.QUser.user;
/**
 * Created by As on 2015/8/27.
 */
public class UserRepositoryImpl extends AbstractQueryDSLRepo implements UserRepositoryCustom {
    public UserRepositoryImpl() {
        super(User.class);
    }

    @Override
    public boolean isUserExist(String username) {
        return from(user).where(user.username.eq(username)).exists();
    }

    @Override
    public boolean checkUser(String username, String password) {
        return from(user).where(user.username.eq(username).and(user.password.eq(password))).exists();
    }
}
